<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>点击穿透</title>
    <style>
        *{
            margin: 0;
            padding:0;
        }
        html, body, #container{
            width: 100%;
            height: 100%;
            background: linear-gradient(to bottom, #9af, #afe);
        }
        #banner{
            display:block;
            margin: 20px auto;
            width: 95%;
            height: 200px;
            background: rgb(137, 43, 168);
        }
        .mask{
            position:absolute;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0, 0.4);
            left: 0;
            top: 0;
            padding-top: 20px;
            text-align:center;
        }
    </style>
</head>
<body>
    <div id="container">
        <a id="banner" href="http://www.atguigu.com"></a>

        <div class="mask">
            <p>恭喜恭喜, 喜提劳斯莱斯优惠券</p>
            <button class="close">点击关闭</button>
        </div>
    </div>

    <script>
        let close = document.querySelector('.close');
        let mask = document.querySelector('.mask');

        close.addEventListener('click', function(){
            mask.style.display = 'none';
        }); 
    </script>
</body>
</html>